<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页三</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="css/public.css" media="all">
</head>
<body>
<!--<div class="layuimini-container">-->
<div class="layuimini-main">
    <!--栗浩-->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv1" style="background-color:#ffffff;min-height:400px;padding: 10px"></div>
        </div>
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv2" style="background-color:#ffffff;min-height:400px;padding: 10px"></div>
        </div>
    </div>

    <!--陈国强-->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv3" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv4" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
    </div>

    <!--秦和运-->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv5" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv6" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
    </div>

    <!--赵申奥-->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv7" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv8" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
    </div>

    <!--马冉一夫-->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv9" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
        <div class="layui-col-xs12 layui-col-md6">
            <div id="dv10" style="background-color:#ffffff;min-height:300px;padding: 10px"></div>
        </div>
    </div>


</div>
<!--</div>-->
<script src="lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="lib/echarts.min.js"></script>
<script>
    layui.use(['layer', 'echarts'], function () {
            var $ = layui.jquery,
                layer = layui.layer,
                echarts = layui.echarts;

            /**
             * 报表功能 栗浩
             */
            var dv1 = echarts.init(document.getElementById('dv1'), 'walden');
            var optionRecords = {
                title: {
                    text: '物业公司人数统计',
                    left: 'center'
                },
                xAxis: {
                    data: [],
                    axisLabel: {
                        inside: true,
                        color: '#fff'
                    },
                    axisTick: {
                        show: false
                    },
                    axisLine: {
                        show: false
                    },
                    z: 10
                },
                yAxis: {
                    axisLine: {
                        show: false
                    },
                    axisTick: {
                        show: false
                    },
                    axisLabel: {
                        color: '#999'
                    }
                },
                dataZoom: [
                    {
                        type: 'inside'
                    }
                ],
                series: [
                    {
                        type: 'bar',
                        showBackground: true,
                        itemStyle: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                {offset: 0, color: '#83bff6'},
                                {offset: 0.5, color: '#188df0'},
                                {offset: 1, color: '#188df0'}
                            ])
                        },
                        emphasis: {
                            itemStyle: {
                                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                    {offset: 0, color: '#2378f7'},
                                    {offset: 0.7, color: '#2378f7'},
                                    {offset: 1, color: '#83bff6'}
                                ])
                            }
                        },
                        data: []
                    }
                ]
            };
            dv1.setOption(optionRecords);
            //请求接口 获取真实数据 Ajax
            $.get("/api/companyemp/companyempcount.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    //填入数据
                    optionRecords = ({
                        xAxis: {
                            data: res.data.companyName
                        },
                        series: [{
                            // 根据名字对应到相应的系列
                            data: res.data.num
                        }]
                    });
                    dv1.setOption(optionRecords);
                }
            })


            /**
             * 报表功能 栗浩
             */
            //请求接口 获取真实数据 Ajax
            var dv2 = echarts.init(document.getElementById('dv2'), 'walden');
            var dv22 = {
                title: {
                    text: '院系专业统计',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        dataView: {readOnly: false},
                        magicType: {type: ['line', 'bar']},
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: []
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [120, 200, 150],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            dv2.setOption(dv22)
            //请求接口 获取真实数据 Ajax
            $.get("/api/college/collegemajorcount.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    dv22.xAxis.data = res.data.deptName;
                    dv22.series[0].data = res.data.num;
                    dv2.setOption(dv22)
                }
            })


            /**
             * 报表功能 公寓收费标准中的单位陈国强
             */
            var echartsPie = echarts.init(document.getElementById('dv3'), 'walden');
            var option = {
                title: {
                    text: '各宿舍楼学生人数',
                    subtext: '',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left'
                },
                series: [
                    {
                        name: 'Access From',
                        type: 'pie',
                        radius: '50%',
                        data: [
                            {value: 1048, name: 'Search Engine'},
                            {value: 735, name: 'Direct'},
                            {value: 580, name: 'Email'},
                            {value: 484, name: 'Union Ads'},
                            {value: 300, name: 'Video Ads'}
                        ],
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            echartsPie.setOption(option)
            //请求接口 获取真实数据 Ajax
            $.get("/api/LeaveSchool/roletj.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    option.series[0].data = res.data;
                    echartsPie.setOption(option);
                    // optionLeaveSchool.xAxis.data = res.data.address;
                    // optionLeaveSchool.series[0].data = res.data.num;
                    // echartsPie.setOption(optionLeaveSchool)
                }
            })

            /**
             * 报表功能 实现公寓收费标准单位个数的统计
             * 陈国强
             */
            var dv4 = echarts.init(document.getElementById('dv4'), 'walden');
            var optionPies = {
                title: {
                    text: '公寓居住时间单位统计',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        dataView: {readOnly: false},
                        magicType: {type: ['line', 'bar']},
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: []
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [120, 200, 150],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            dv4.setOption(optionPies)
            //请求接口 获取真实数据 Ajax
            $.get("/api/ApartmentChaNorm/roletj.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    optionPies.xAxis.data = res.data.unit;
                    optionPies.series[0].data = res.data.num;
                    dv4.setOption(optionPies)
                }
            })



        /**
         * 报表功能 秦和运
         */
        var dv5 = echarts.init(document.getElementById('dv5'), 'walden');
        var dv55 = {
            title: {
                text: '维修人员施工统计',
                left: 'center'
            },
            tooltip: {
                trigger: 'axis'
            },
            toolbox: {
                show: true,
                feature: {
                    dataZoom: {
                        yAxisIndex: 'none'
                    },
                    dataView: {readOnly: false},
                    magicType: {type: ['line', 'bar']},
                    restore: {},
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                data: []
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: [120, 200, 150],
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                }
            ]
        };
        dv5.setOption(dv55);
        //请求后端接口
        $.get("/api/msc/num.do", function (res) {
            if (res.code == 0) {
                //赋值
                dv55.xAxis.data = res.data.maintenanceName;
                dv55.series[0].data = res.data.num;
                dv5.setOption(dv55);
            }
        })


        /**
         * 报表功能 秦和运
         */
        var dv6 = echarts.init(document.getElementById('dv6'), 'walden');
        var dv66 = {
            title: {
                text: '报修原因统计',
                left: 'center',
                textStyle: {
                    color: 'black'
                }
            },
            xAxis: {
                data: [1,2,3],
                axisLabel: {
                    inside: true,
                    color: '#fff'
                },
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false
                },
                z: 10
            },
            yAxis: {
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    color: '#999'
                }
            },
            dataZoom: [
                {
                    type: 'inside'
                }
            ],
            series: [
                {
                    type: 'bar',
                    showBackground: true,
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {offset: 0, color: '#83bff6'},
                            {offset: 0.5, color: '#188df0'},
                            {offset: 1, color: '#188df0'}
                        ])
                    },
                    emphasis: {
                        itemStyle: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                {offset: 0, color: '#2378f7'},
                                {offset: 0.7, color: '#2378f7'},
                                {offset: 1, color: '#83bff6'}
                            ])
                        }
                    },
                    data: [1,2,3]
                }
            ]
        };
        dv6.setOption(dv66);
        $.get("/api/srl/num.do", function (res) {
            if (res.code == 0) {
                //赋值
                //填入数据
                dv66 = ({
                    xAxis: {
                        data: res.data.cause
                    },
                    series: [{
                        // 根据名字对应到相应的系列
                        data: res.data.num
                    }]
                });
                dv6.setOption(dv66);
            }
        })


            /**
             * 报表功能 赵申奥
             */
            var dv7 = echarts.init(document.getElementById('dv7'), 'walden');
            var dv77 = {
                title: {
                    text: '宿舍楼栋图表',
                    left: 'center',
                    textStyle: {
                        color: 'purple'
                    }
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        dataView: {readOnly: false},
                        magicType: {type: ['line', 'bar']},
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: ['西苑', '玉亭', '秋居']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [4, 1, 1],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            dv7.setOption(optionRecords);
            //请求接口 获取真实数据 Ajax
            $.get("/api/check/selectcount.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    //填入数据
                    dv77 = ({
                        xAxis: {
                            data: res.data.address
                        },
                        series: [{
                            // 根据名字对应到相应的系列
                            data: res.data.num
                        }]
                    });
                    dv7.setOption(dv77);
                }
            })
            dv7.setOption(dv77);


            //请求接口 获取真实数据 Ajax

            /**
             * 报表功能 赵申奥
             */
            var dv8 = echarts.init(document.getElementById('dv8'), 'walden');
            var dv88 = {
                title: {
                    text: '宿舍分数图表',
                    left: 'center',
                    textStyle: {
                        color: 'purple'
                    }
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        dataView: {readOnly: false},
                        magicType: {type: ['line', 'bar']},
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: ['西苑', '玉亭', '秋居']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [150, 100, 120],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            dv8.setOption(dv88);
            //请求接口 获取真实数据 Ajax
            $.get("/api/check/selectcount.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    //填入数据
                    dv88 = ({
                        xAxis: {
                            data: res.data.address
                        },
                        series: [{
                            // 根据名字对应到相应的系列
                            data: res.data.num
                        }]
                    });
                    dv8.setOption(dv88);
                }
            })
            dv8.setOption(dv88);



            /**
             * 报表功能 马冉一夫
             */
            var dv9 = echarts.init(document.getElementById('dv9'), 'walden');
            var dv99 = {
                title: {
                    text: '住宿统计',
                    left: 'center',
                    textStyle: {
                        color: 'red'
                    }
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        dataView: {readOnly: false},
                        magicType: {type: ['line', 'bar']},
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: ['人数', '交费', '楼']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [120, 200, 150],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            dv9.setOption(dv99);
            //请求接口 获取真实数据 Ajax
            $.get("/api/accommodationExpenseStatistics/tubiao.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    //填入数据
                    dv99 = ({
                        xAxis: {
                            data: res.data.paytotal
                        },
                        series: [{
                            // 根据名字对应到相应的系列
                            data: res.data.num
                        }]
                    });
                    dv9.setOption(dv99);
                }
            })
        // echarts 窗口缩放自适应


            /**
             * 报表功能 马冉一夫
             */
            var dv10 = echarts.init(document.getElementById('dv10'), 'walden');
            var dv100 = {
                title: {
                    text: '数量统计',
                    left: 'center',
                    textStyle: {
                        color: 'red'
                    }
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    show: true,
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        dataView: {readOnly: false},
                        magicType: {type: ['line', 'bar']},
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: ['现有', '总金额']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [500, 250],
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            dv10.setOption(dv100);
            //请求接口 获取真实数据 Ajax
            $.get("/api/inventoryOfExistingArticles/tubiao.do", function (res) {
                if (res.code == 0) {
                    //赋值
                    //填入数据
                    dv100 = ({
                        xAxis: {
                            data: res.data.goodsname
                        },
                        xAxis: {
                            data: res.data.money
                        },
                        series: [{
                            // 根据名字对应到相应的系列
                            data: res.data.num
                        }]
                    });
                    dv10.setOption(dv100);
                }
            })


        }
    )
    ;
</script>
</body>
</html>
